﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using PreguntaAlExperto.RulesLayer.Entities;
using PreguntaAlExperto.RulesLayer.Services;
using Crawler;
using PreguntaAlExperto.TransporterObjectsFramework;
using System.IO;
using System.Collections.Generic;
using System.Text.RegularExpressions;

namespace PreguntaAlExperto
{
    public partial class busqueda : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            BaseList<Article> articles;
            ArticlesService _service = new ArticlesService();

#if SEARCHENABLED
            //articles = new BaseList<Article>();

            //string queryText = Request["q"];
            //string[] words = queryText.Split(new char[]{' '}, StringSplitOptions.RemoveEmptyEntries);

            //Crawler.File[] results = Catalog.Instance.Search(words);

            //foreach (Crawler.File file in results)
            //{
            //    articles.Add(_service.getArticleByPath(Path.GetFileNameWithoutExtension(file.Url) + ".aspx"));    
            //}
#else
            //articles = _service.getAllArticles();
#endif
            //this.dataListNewArticles.DataSource = articles;
            //this.dataListNewArticles.DataBind();
        }
    }
}
